import numpy as np


m=6
max_iteration = 100000
p=0.5
l = 350


def dist(m,max_iteration,p,l):
    x = (l-(m-1)*max_iteration*p)\
        /np.sqrt((m+1)*max_iteration*p*(1-p))

    return x
def dist_5_3(m,max_iteration,p,k):
    x = (k-(m)*max_iteration*p)\
        /np.sqrt((m)*max_iteration*p*(1-p))

    return x

def dist_5_2(m,max_iteration,p,k):
    x = (k-(m)*max_iteration*p)\
        /np.sqrt((m)*max_iteration*p*(1-p))

    return x
# x = dist(m,max_iteration,p,l)
# k=350
# x = dist_5_3(m,max_iteration,p,k)
k=60000
m=1
x = dist_5_3(m,max_iteration,p,k)
print(x)